package com.topvision.myviewtest.other;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.topvision.myviewtest.HomeActivity;

/**
 * Author: lucy
 * Comment: //TODO
 * Date: 2017-11-13 16:32
 */

public class StartPowerReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
        {
            Intent i = new Intent(context, HomeActivity.class);
            i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(i);
        }
    }
}
